package com.timber.util;

import java.util.*;

public class ScreenCache {

  private HashMap screenHash = new HashMap();

  public ScreenCache() {
  }

  public Object getScreenObject (String screenName) {
    // this will either return the JFrame object if found
    // (even if the object is null)
    // else return null
    return screenHash.get( screenName );
  }

  public void setScreenObject (String screenName, Object screenObj) {
    // this will put the JFrame object into the hashmap
    // overwriting if one exists currently with the same key
    screenHash.put( screenName, screenObj );
  }

  public Object removeScreenObject (String screenName) {
    // this will remove and return the JFrame object if found
    // (even if the object is null)
    // else return null
    return screenHash.remove( screenName );
  }
}
